This page last changed on Feb 05, 2009 by cmd0219.

Update view of table with primary key

  • Acceptance criteria:
    • varchars, ints supported
    • "clean" input accepted
    • exceptions accepted if user input is bad
  • Issues:
    • Can we find out if there are primary keys?
    • Can we use JDBC MetaData?
    • Oracle vs. MySQL JDBC driver
Priority
Description Time Estimate
Time Remaining
Actual Time
Last Updated By
Status
  Research/spike relationship between tables and views when updating rows 1.5
.5 1 Paul
In Progress

  Create test VIEWs
.5
0 .5 Paul
Complete
  Design Analysis
4
2
2 Paul
In Progress

  Implementation and refactoring 3.5
3.5
     
  Unit Testing
2
2
     
  Write acceptance tests
2
2      
             
Total   13
9.5
3.5    

Notes

There are issues with updating views of multiple tables.
The approach we think will work is to query for the view definition in vendor specific manor, (MySQL has INFORMATION_SCHEMA table, but slightly different for oracle). Allows for a mapping aliases in the view results to the select statement they map to.

E.g.:
Select C, A FROM view1;
View has columns A, B, C, D, where A maps to t1.c1, B to t1.c2, C to t2.c2, D to t2.c1
Note that the order of columns, and number is not exact from the select and view, and the view's columns could be from other views, meaning the mapping has to be semi-recursive.

Overall: View columns in the select are mapped to the real view columns, then to the table columns they come from.

Document generated by Confluence on May 21, 2009 10:23